Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Jan 5, 2026

Summary

Add pre-push checks to ensure dependency changes are properly validated:

  • lockfile-sync-check: Verify package.json/pnpm-workspace.yaml changes are reflected in pnpm-lock.yaml
  • lint-all-on-lockfile-change: Run full lint when lockfile changes
  • test-all-on-lockfile-change: Run full test suite when lockfile changes

Why

Ensures that dependency changes don't break the build and that lockfile stays in sync with package manifests.


Summary by cubic

Add pre-push lefthook checks to keep the pnpm lockfile in sync and validate dependency changes. This blocks pushes when manifests and the lockfile diverge, and runs full lint/tests on lockfile changes.

  • New Features
    • lockfile-sync-check: verify pnpm-lock.yaml matches all package.json files and pnpm-workspace.yaml using pnpm install --lockfile-only --frozen-lockfile
    • lint-all-on-lockfile-change: run pnpm lint when pnpm-lock.yaml changes
    • test-all-on-lockfile-change: run pnpm test when pnpm-lock.yaml changes

Written for commit d65855f. Summary will update on new commits.

- Add lockfile-sync-check: verify package.json/pnpm-workspace.yaml
  changes are reflected in pnpm-lock.yaml using --frozen-lockfile
- Add lint-all-on-lockfile-change: run full lint when lockfile changes
- Add test-all-on-lockfile-change: run full test suite when lockfile changes

These checks ensure dependency changes are properly validated before push.
@ryoppippi ryoppippi requested a review from a team as a code owner January 5, 2026 16:24
Copilot AI review requested due to automatic review settings January 5, 2026 16:24
Use **/package.json glob pattern to catch changes in workspace packages.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@277

commit: a8fd5f8

@ryoppippi ryoppippi merged commit d32fe37 into main Jan 5, 2026
15 checks passed
@ryoppippi ryoppippi deleted the chore/lefthook-lockfile-checks branch January 5, 2026 16:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds three pre-push Git hooks to validate dependency changes and ensure the lockfile stays synchronized with package manifests. The checks aim to prevent broken builds by running comprehensive tests and linting when dependencies are modified.

  • Adds lockfile synchronization verification for package.json and pnpm-workspace.yaml changes
  • Triggers full linting when pnpm-lock.yaml is modified
  • Triggers full test suite execution when pnpm-lock.yaml is modified

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

run: pnpm run lint:knip
- name: lockfile-sync-check
glob: '{**/package.json,pnpm-workspace.yaml}'
run: pnpm install --lockfile-only --frozen-lockfile
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The combination of --lockfile-only and --frozen-lockfile flags is contradictory. The --lockfile-only flag tells pnpm to update the lockfile, while --frozen-lockfile requires that the lockfile must not be modified. This command will fail.

For verifying that package.json/pnpm-workspace.yaml changes are reflected in pnpm-lock.yaml, you should use only --frozen-lockfile (which will fail if the lockfile is out of sync) or consider using pnpm install --frozen-lockfile --dry-run to verify without making changes.

Suggested change
run: pnpm install --lockfile-only --frozen-lockfile
run: pnpm install --frozen-lockfile --dry-run

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="lefthook.yaml">

<violation number="1" location="lefthook.yaml:24">
P2: Glob pattern should include workspace `package.json` files. In this monorepo, changes to `examples/package.json` won&#39;t trigger this lockfile sync check. Consider using `&#39;{**/package.json,pnpm-workspace.yaml}&#39;` to catch all package manifest changes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

lefthook.yaml Outdated
- name: knip
run: pnpm run lint:knip
- name: lockfile-sync-check
glob: '{package.json,pnpm-workspace.yaml}'
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Glob pattern should include workspace package.json files. In this monorepo, changes to examples/package.json won't trigger this lockfile sync check. Consider using '{**/package.json,pnpm-workspace.yaml}' to catch all package manifest changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lefthook.yaml, line 24:

<comment>Glob pattern should include workspace `package.json` files. In this monorepo, changes to `examples/package.json` won&#39;t trigger this lockfile sync check. Consider using `&#39;{**/package.json,pnpm-workspace.yaml}&#39;` to catch all package manifest changes.</comment>

<file context>
@@ -20,3 +20,12 @@ pre-push:
     - name: knip
       run: pnpm run lint:knip
+    - name: lockfile-sync-check
+      glob: &#39;{package.json,pnpm-workspace.yaml}&#39;
+      run: pnpm install --lockfile-only --frozen-lockfile
+    - name: lint-all-on-lockfile-change
</file context>
Suggested change
glob: '{package.json,pnpm-workspace.yaml}'
glob: '{**/package.json,pnpm-workspace.yaml}'
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants